import { ConditionList } from "~/search.match";

import { getGateway, Gateway } from "@/droplet-bus/core.define";

import { TonOrder, TonOrderGroup } from "@/river-ton/schema.order";
import { RiverTonGateway } from "@/river-ton/core.define";
import { NotchQuery } from "@/river-stock/core.define";

export const TonOrderNotchStatGateway: Gateway = getGateway(RiverTonGateway, "river_ton_order_notch_stat");

export type getTonOrderNotchStatDto = {
  conditionList: ConditionList<TonOrder>;
  groupId: TonOrderGroup["id"];
  query: NotchQuery[];
};

export interface TonOrderNotchStatInterfaceWithGrant<T> {
  /** 例如：在订单左下角，显示还应未入库/未发货/延期处理多少吨 */
  getTonOrderNotchStat(dto: T & getTonOrderNotchStatDto): Promise<(NotchQuery & { total: number })[]>;
}
